<template>
	<section>
		<!--工具条-->
		<el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
			<el-form :inline="true" :model="filters">
				<el-form-item>
					<el-input v-model="filters.name" placeholder="任务名称"></el-input>
				</el-form-item>
				<el-form-item>
					<el-button type="primary" v-on:click="getTask">查询</el-button>
				</el-form-item>
			</el-form>
		</el-col>

		<!--列表-->
		<template>
			<el-table :data="tasks" highlight-current-row v-loading="loading" style="width: 100%;">
				<el-table-column type="index" width="60">
				</el-table-column>
				<el-table-column prop="task_num" label="任务编号" width="200" sortable>
				</el-table-column>
				<el-table-column prop="name" label="任务名称" width="120" sortable>
				</el-table-column>
				<el-table-column prop="describe" label="任务描述" width="400" sortable>
				</el-table-column>
				<el-table-column prop="task_value" label="任务报酬" width="100" sortable>
				</el-table-column>
			</el-table>
		</template>

	</section>
</template>
<script>
  // import axios from 'axios';
  import { getTaskList } from '../../api/api';
	//import NProgress from 'nprogress'
	export default {
		data() {
			return {
				filters: {
					name: ''
				},
				loading: false,
				tasks: []
			}
		},
		methods: {
			//获取任务列表
      getTask: function() {
				let para = {
					last_id: 0
				};
				this.loading = true;
				getTaskList(para).then((res) => {
					this.tasks = res.data.data;
					this.loading = false;
				});
      }
		},
		mounted() {
      this.getTask();
		}
	};

</script>

<style scoped>

</style>
